import * as PIXI from 'pixi.js';
import { timeTween } from './timeTween';
/**
 * 淡出
 * @param ticker
 * @param display
 * @param time
 */
export async function fadeOut(
  ticker: PIXI.Ticker,
  display: PIXI.DisplayObject,
  time = 500,
) {
  display.visible = true;
  display.alpha = 1
  await timeTween(ticker, [1], [0], time, (p) => display.alpha = p[0])
  display.visible = false;
}
